package me.winter.imgop;


public class CopyLeftHalf extends ImageFilter {

    @Override
	public int [][] pixelFilter( int [][] shades ) {
        int width  = (shades.length % 2 == 0) ? shades.length / 2
                                              : shades.length / 2 + 1;
        int height = shades[0].length;
        int [][] result = new int[width][height];

        for (int x = 0; x < width; ++x) {
            for (int y = 0; y < height; ++y) {
                result[x][y] = shades[x][y];
            }
        }

        return result;
    }
}